\hypertarget{class_pulse_audio_output}{
\section{PulseAudioOutput Class Reference}
\label{class_pulse_audio_output}\index{PulseAudioOutput@{PulseAudioOutput}}
}


Pulse Audio output device to play sound effects.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_pulse_audio_output_a2423b3643c93d38dd1a91ff3de10afa8}{
\hyperlink{class_pulse_audio_output_a2423b3643c93d38dd1a91ff3de10afa8}{PulseAudioOutput} (const QByteArray \&\hyperlink{class_pulse_audio_output_a23f2871050dbc73ffd978d9dc3592080}{device}, QObject $\ast$parent=0)}
\label{class_pulse_audio_output_a2423b3643c93d38dd1a91ff3de10afa8}

\begin{DoxyCompactList}\small\item\em Constructs Pulse Audio output device. \item\end{DoxyCompactList}\item 
\hyperlink{class_pulse_audio_output_a7127046c213411fb8e0fdd49a5b73ba5}{$\sim$PulseAudioOutput} ()
\begin{DoxyCompactList}\small\item\em Destructs Pulse Audio output device. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_ae9c82fd99b7c32515bcba03e9e05a6c8}{
void \hyperlink{class_pulse_audio_output_ae9c82fd99b7c32515bcba03e9e05a6c8}{setVolumeLevel} (int volumeLevel)}
\label{class_pulse_audio_output_ae9c82fd99b7c32515bcba03e9e05a6c8}

\begin{DoxyCompactList}\small\item\em Sets {\itshape volumelevel\/} for output device. \item\end{DoxyCompactList}\item 
void \hyperlink{class_pulse_audio_output_a54ad40c4caafd7f4c768512f48e02062}{addSoundBuffer} (\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType} effectType, QBuffer $\ast$soundBuffer)
\begin{DoxyCompactList}\small\item\em Adds sound data for sound effect. \item\end{DoxyCompactList}\item 
void \hyperlink{class_pulse_audio_output_a6b4ae25f9a289a9a4e0259a9a8e8c714}{start} (\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType} soundEffect)
\begin{DoxyCompactList}\small\item\em Starts the playback of the sound affect given at the parameter {\itshape soundEffect\/}. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_ac49d04220b99ff78c877c13078564b7f}{
void \hyperlink{class_pulse_audio_output_ac49d04220b99ff78c877c13078564b7f}{stop} ()}
\label{class_pulse_audio_output_ac49d04220b99ff78c877c13078564b7f}

\begin{DoxyCompactList}\small\item\em Stops the playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_ae47a58a2e3b4093cc53bdd6054fd34c3}{
void \hyperlink{class_pulse_audio_output_ae47a58a2e3b4093cc53bdd6054fd34c3}{reset} ()}
\label{class_pulse_audio_output_ae47a58a2e3b4093cc53bdd6054fd34c3}

\begin{DoxyCompactList}\small\item\em Resets the output device. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a94849e7810419d700ba37d6a7667a063}{
void \hyperlink{class_pulse_audio_output_a94849e7810419d700ba37d6a7667a063}{suspend} ()}
\label{class_pulse_audio_output_a94849e7810419d700ba37d6a7667a063}

\begin{DoxyCompactList}\small\item\em Set the output device to suspended state. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a1e4903a101063b0afe2061a22e96cc05}{
void \hyperlink{class_pulse_audio_output_a1e4903a101063b0afe2061a22e96cc05}{resume} ()}
\label{class_pulse_audio_output_a1e4903a101063b0afe2061a22e96cc05}

\begin{DoxyCompactList}\small\item\em Resumes the output device from suspended state. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a1ae7d55a4d5e6874a71ae9bec6d48adc}{
int \hyperlink{class_pulse_audio_output_a1ae7d55a4d5e6874a71ae9bec6d48adc}{bytesFree} () const }
\label{class_pulse_audio_output_a1ae7d55a4d5e6874a71ae9bec6d48adc}

\begin{DoxyCompactList}\small\item\em Gets number of free bytes available at the output stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a96e54a6f23336499418b416a96ede173}{
QAudio::Error \hyperlink{class_pulse_audio_output_a96e54a6f23336499418b416a96ede173}{error} () const }
\label{class_pulse_audio_output_a96e54a6f23336499418b416a96ede173}

\begin{DoxyCompactList}\small\item\em Get error status from the output device. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_acb3d80ab709b701471b52664e238edef}{
QAudio::State \hyperlink{class_pulse_audio_output_acb3d80ab709b701471b52664e238edef}{state} () const }
\label{class_pulse_audio_output_acb3d80ab709b701471b52664e238edef}

\begin{DoxyCompactList}\small\item\em Get status from the output device. \item\end{DoxyCompactList}\item 
void \hyperlink{class_pulse_audio_output_a84ef84624a12e91252aaa0f5b4b5087c}{setFormat} (const QAudioFormat \&format)
\begin{DoxyCompactList}\small\item\em Sets the audio format used at playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_ac3a30b90ed028e8eada96edff79ca39c}{
QAudioFormat \hyperlink{class_pulse_audio_output_ac3a30b90ed028e8eada96edff79ca39c}{format} () const }
\label{class_pulse_audio_output_ac3a30b90ed028e8eada96edff79ca39c}

\begin{DoxyCompactList}\small\item\em Gets the audio format used at playback. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Slots}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{class_pulse_audio_output_a3f9c1669179a41814bc731ed3b6be5ce}{feedSoundData} ()
\begin{DoxyCompactList}\small\item\em Feeds sound data to output device. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_pulse_audio_output_a6027125727687efd00f56acfd9a97305}{
void \hyperlink{class_pulse_audio_output_a6027125727687efd00f56acfd9a97305}{stopOutput} ()}
\label{class_pulse_audio_output_a6027125727687efd00f56acfd9a97305}

\begin{DoxyCompactList}\small\item\em Stops audio output. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_af22fdf54410ffba42182d533b7944327}{
qint64 \hyperlink{class_pulse_audio_output_af22fdf54410ffba42182d533b7944327}{write} (const char $\ast$data, qint64 length)}
\label{class_pulse_audio_output_af22fdf54410ffba42182d533b7944327}

\begin{DoxyCompactList}\small\item\em Writes {\itshape data\/} with {\itshape length\/} to the Pulse Audio stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_aa5d7a9459d7d97048f144eac40833a8f}{
qint64 \hyperlink{class_pulse_audio_output_aa5d7a9459d7d97048f144eac40833a8f}{writeDataToOutputDevice} ()}
\label{class_pulse_audio_output_aa5d7a9459d7d97048f144eac40833a8f}

\begin{DoxyCompactList}\small\item\em Writes sound data from sound buffer to output device. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_pulse_audio_output_a23f2871050dbc73ffd978d9dc3592080}{
QByteArray \hyperlink{class_pulse_audio_output_a23f2871050dbc73ffd978d9dc3592080}{device}}
\label{class_pulse_audio_output_a23f2871050dbc73ffd978d9dc3592080}

\begin{DoxyCompactList}\small\item\em Audio sink for output. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a24d77bd6a8a40e5e8cb470e373ded9af}{
QByteArray \hyperlink{class_pulse_audio_output_a24d77bd6a8a40e5e8cb470e373ded9af}{streamName}}
\label{class_pulse_audio_output_a24d77bd6a8a40e5e8cb470e373ded9af}

\begin{DoxyCompactList}\small\item\em Output stream name. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_ac85c0ccf466c5384d973c2adc09f4ed6}{
QAudioFormat \hyperlink{class_pulse_audio_output_ac85c0ccf466c5384d973c2adc09f4ed6}{audioFormat}}
\label{class_pulse_audio_output_ac85c0ccf466c5384d973c2adc09f4ed6}

\begin{DoxyCompactList}\small\item\em Audio Format for output. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_abda5d48ede737e76dc434170790aa4a1}{
QAudio::Error \hyperlink{class_pulse_audio_output_abda5d48ede737e76dc434170790aa4a1}{errorState}}
\label{class_pulse_audio_output_abda5d48ede737e76dc434170790aa4a1}

\begin{DoxyCompactList}\small\item\em Error state. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a5c5f698a8a94d7fb4170e027a7d295ec}{
QAudio::State \hyperlink{class_pulse_audio_output_a5c5f698a8a94d7fb4170e027a7d295ec}{deviceState}}
\label{class_pulse_audio_output_a5c5f698a8a94d7fb4170e027a7d295ec}

\begin{DoxyCompactList}\small\item\em Device state. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a47c9ef7d631d16a22a7eadeb581dd027}{
bool \hyperlink{class_pulse_audio_output_a47c9ef7d631d16a22a7eadeb581dd027}{opened}}
\label{class_pulse_audio_output_a47c9ef7d631d16a22a7eadeb581dd027}

\begin{DoxyCompactList}\small\item\em Is the output stream opened. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_aa4fd99b5d629a3fdc940cf3e912a7d2a}{
int \hyperlink{class_pulse_audio_output_aa4fd99b5d629a3fdc940cf3e912a7d2a}{bytesAvailable}}
\label{class_pulse_audio_output_aa4fd99b5d629a3fdc940cf3e912a7d2a}

\begin{DoxyCompactList}\small\item\em Free bytes available at output stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a1a5119df5b908caa611013db3a87bcd9}{
pa\_\-stream $\ast$ \hyperlink{class_pulse_audio_output_a1a5119df5b908caa611013db3a87bcd9}{stream}}
\label{class_pulse_audio_output_a1a5119df5b908caa611013db3a87bcd9}

\begin{DoxyCompactList}\small\item\em Output stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a4cef5b38eed7d031adc7e8b170f08dab}{
int \hyperlink{class_pulse_audio_output_a4cef5b38eed7d031adc7e8b170f08dab}{periodSizeValue}}
\label{class_pulse_audio_output_a4cef5b38eed7d031adc7e8b170f08dab}

\begin{DoxyCompactList}\small\item\em Size of buffer feed to output stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a3b9e2f7640c575f4e2a54bd30385fecc}{
QTimer $\ast$ \hyperlink{class_pulse_audio_output_a3b9e2f7640c575f4e2a54bd30385fecc}{tickTimer}}
\label{class_pulse_audio_output_a3b9e2f7640c575f4e2a54bd30385fecc}

\begin{DoxyCompactList}\small\item\em Timer for feeding data to output stream. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a9ed60b0f801e187ab8aaaefea5b8350c}{
bool \hyperlink{class_pulse_audio_output_a9ed60b0f801e187ab8aaaefea5b8350c}{resuming}}
\label{class_pulse_audio_output_a9ed60b0f801e187ab8aaaefea5b8350c}

\begin{DoxyCompactList}\small\item\em Is the playback resuming from suspend. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a5c72ca3b0d06cf327b22a20d2bd73fe7}{
\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType} \hyperlink{class_pulse_audio_output_a5c72ca3b0d06cf327b22a20d2bd73fe7}{effectPlaying}}
\label{class_pulse_audio_output_a5c72ca3b0d06cf327b22a20d2bd73fe7}

\begin{DoxyCompactList}\small\item\em Type of sound effect currently playing. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_a478811c1f849475fd34b146ac0467956}{
int \hyperlink{class_pulse_audio_output_a478811c1f849475fd34b146ac0467956}{volume}}
\label{class_pulse_audio_output_a478811c1f849475fd34b146ac0467956}

\begin{DoxyCompactList}\small\item\em Current output volume. \item\end{DoxyCompactList}\item 
\hypertarget{class_pulse_audio_output_af7ec4301866234f966f094d49f2fcd73}{
QBuffer $\ast$ \hyperlink{class_pulse_audio_output_af7ec4301866234f966f094d49f2fcd73}{soundsBufferArray} \mbox{[}NumberOfSounds\mbox{]}}
\label{class_pulse_audio_output_af7ec4301866234f966f094d49f2fcd73}

\begin{DoxyCompactList}\small\item\em Sound data array. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Pulse Audio output device to play sound effects. Output device that plays sound effects using Pulse Audio sound server. Contains also data buffers for different sound effects.

\begin{DoxySeeAlso}{See also}
\hyperlink{class_sound_engine_pulse_audio}{SoundEnginePulseAudio} \hyperlink{class_sound_engine}{SoundEngine} 
\end{DoxySeeAlso}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_pulse_audio_output_a7127046c213411fb8e0fdd49a5b73ba5}{
\index{PulseAudioOutput@{PulseAudioOutput}!$\sim$PulseAudioOutput@{$\sim$PulseAudioOutput}}
\index{$\sim$PulseAudioOutput@{$\sim$PulseAudioOutput}!PulseAudioOutput@{PulseAudioOutput}}
\subsubsection[{$\sim$PulseAudioOutput}]{\setlength{\rightskip}{0pt plus 5cm}PulseAudioOutput::$\sim$PulseAudioOutput (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_pulse_audio_output_a7127046c213411fb8e0fdd49a5b73ba5}


Destructs Pulse Audio output device. 

Stops output. 

\subsection{Member Function Documentation}
\hypertarget{class_pulse_audio_output_a54ad40c4caafd7f4c768512f48e02062}{
\index{PulseAudioOutput@{PulseAudioOutput}!addSoundBuffer@{addSoundBuffer}}
\index{addSoundBuffer@{addSoundBuffer}!PulseAudioOutput@{PulseAudioOutput}}
\subsubsection[{addSoundBuffer}]{\setlength{\rightskip}{0pt plus 5cm}void PulseAudioOutput::addSoundBuffer (
\begin{DoxyParamCaption}
\item[{{\bf SoundEffectType}}]{ effectType, }
\item[{QBuffer $\ast$}]{ soundBuffer}
\end{DoxyParamCaption}
)}}
\label{class_pulse_audio_output_a54ad40c4caafd7f4c768512f48e02062}


Adds sound data for sound effect. 

Type of sound effect is given at the {\itshape effectType\/} parameter. Sound data is given at the {\itshape soundBuffer\/} parameter. \begin{DoxySeeAlso}{See also}
\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType}. 
\end{DoxySeeAlso}
\hypertarget{class_pulse_audio_output_a3f9c1669179a41814bc731ed3b6be5ce}{
\index{PulseAudioOutput@{PulseAudioOutput}!feedSoundData@{feedSoundData}}
\index{feedSoundData@{feedSoundData}!PulseAudioOutput@{PulseAudioOutput}}
\subsubsection[{feedSoundData}]{\setlength{\rightskip}{0pt plus 5cm}void PulseAudioOutput::feedSoundData (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private, slot\mbox{]}}}}
\label{class_pulse_audio_output_a3f9c1669179a41814bc731ed3b6be5ce}


Feeds sound data to output device. 

Feed interval is \hypertarget{class_pulse_audio_output_a84ef84624a12e91252aaa0f5b4b5087c}{
\index{PulseAudioOutput@{PulseAudioOutput}!setFormat@{setFormat}}
\index{setFormat@{setFormat}!PulseAudioOutput@{PulseAudioOutput}}
\subsubsection[{setFormat}]{\setlength{\rightskip}{0pt plus 5cm}void PulseAudioOutput::setFormat (
\begin{DoxyParamCaption}
\item[{const QAudioFormat \&}]{ format}
\end{DoxyParamCaption}
)}}
\label{class_pulse_audio_output_a84ef84624a12e91252aaa0f5b4b5087c}


Sets the audio format used at playback. 

Format is given at the parameter {\itshape format\/}. \hypertarget{class_pulse_audio_output_a6b4ae25f9a289a9a4e0259a9a8e8c714}{
\index{PulseAudioOutput@{PulseAudioOutput}!start@{start}}
\index{start@{start}!PulseAudioOutput@{PulseAudioOutput}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}void PulseAudioOutput::start (
\begin{DoxyParamCaption}
\item[{{\bf SoundEffectType}}]{ soundEffect}
\end{DoxyParamCaption}
)}}
\label{class_pulse_audio_output_a6b4ae25f9a289a9a4e0259a9a8e8c714}


Starts the playback of the sound affect given at the parameter {\itshape soundEffect\/}. 

\begin{DoxySeeAlso}{See also}
\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType}. 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
pulseaudiooutput.h\item 
pulseaudiooutput.cpp\end{DoxyCompactItemize}
